package com.heeexy.example.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.heeexy.example.dao.LogDao;
import com.heeexy.example.service.LogService;
import com.heeexy.example.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {


    @Autowired
    private LogDao logDao;

    @Override
    public JSONObject getLog(JSONObject jsonObject){
        CommonUtil.fillPageParam(jsonObject);
        int count = logDao.countLog(jsonObject);
        List<JSONObject> roles = logDao.getLogInfo(jsonObject);
        return CommonUtil.successPage(jsonObject,roles,count);
    }

    public JSONObject updateLog(JSONObject jsonObject){
        logDao.updateLog(jsonObject);
        return CommonUtil.successJson();
    }
}
